//var hide_empty_list=true;
var disable_empty_list=true; //uncomment this line to disable empty selection lists
addListGroup("divisions", "division");

addList("division", "Select a division", "", "");
<%for(int divisions=1;divisions<=season.getDivisions().size();divisions++){%>
addList("division", "<%if(season.isLeague()){%>Division<%}else{%> Group <%}%> <%=divisions%>", "<%=divisions%>", "division<%=divisions%>");

<%Division division1 = (Division)season.getDivisions().get(divisions);%>
addList("division<%=divisions%>", "Select home team", "", "");
<%for(int i=0;i<division1.teamArray().length;i++){
Team team = division1.teamArray()[i];%>
<%if(team!=null){%>addList("division<%=divisions%>", "<%=team.getName()%>", "<%=team.getID()%>", "division<%=divisions%>HOME");<%}%>




<%}%>
addOption("division<%=divisions%>HOME", "Select away team", "");
<%for(int j=0;j<division1.teamArray().length;j++){
Team teamB = division1.teamArray()[j];%>

<%if(teamB!=null){%>addOption("division<%=divisions%>HOME", "<%=teamB.getName()%>", "<%=teamB.getID()%>");<%}%>

<%}%>



<%}%>


